﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Business;
namespace QLHS
{
    public partial class UCTongKetMon : UserControl
    {
        public UCTongKetMon()
        {
            InitializeComponent();
        }
        MonHoc_BUL bu = new MonHoc_BUL();

        private void UCTongKetMon_Load(object sender, EventArgs e)
        {
            
        }
        private void cbohk_SelectedIndexChanged(object sender, EventArgs e)
        {
            lo_mon.Properties.DataSource = bu.Laymon(cbohk.Text);
            lo_mon.Properties.DisplayMember = "TENMON";
            lo_mon.Properties.ValueMember = "TENMON";
        }

        private void btnxem_Click(object sender, EventArgs e)
        {
            gridControl1.DataSource = bu.LoadTB();
        }

        private void lo_mon_EditValueChanged(object sender, EventArgs e)
        {
            gridControl1.DataSource = bu.Loaddata(lo_mon.Text,cbohk.Text);
        }

        private void btnin_Click(object sender, EventArgs e)
        {
            if (lo_mon.Text == "" || cbohk.Text == "")
                MessageBox.Show("Vui lòng chọn Môn và Học Kỳ cần xem", "Thông Báo");
            else
            {
                frm_Report f = new frm_Report(4,"",cbohk.Text,lo_mon.Text);
                f.Show();
            }
        }
    }
}
